﻿using HKSdkLibrary;
using Ozone.Device;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Ozone.Views.Video
{
    /// <summary>
    /// BigVideoWindow.xaml 的交互逻辑
    /// </summary>
    public partial class BigVideoWindow : Window
    {
        private HKCam KCam;
        public BigVideoWindow()
        {
            InitializeComponent();
            this.Closed += Wind_Closed;
        }
        public int ShowBigVideo(string IpAddress, string password, string Title, HKCam hKCam,int nPos)
        {
            KCam = hKCam;
            pageVideoBig.btnBigVideo.IsEnabled = false;
            DeviceCenter.Entity.uCVideoMonitors.Add(pageVideoBig);
            KCam.nBigNum = DeviceCenter.Entity.uCVideoMonitors.Count - 1;
            KCam.IsBig = true;
            return KCam.LoginAndPreview(IpAddress, password,Title,nPos, pageVideoBig);
        }
        private void Wind_Closed(object sender, EventArgs e)
        {
            DeviceCenter.Entity.uCVideoMonitors.RemoveAt(KCam.nBigNum);
            KCam.IsBig = false;
        }
    }
}